{include file="public/head" /}

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>后台管理</cite></a>
        <a><cite>物业管理系统</cite></a>
        <a><cite>物业信息</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so"  method="get" action="#">
            <div class="layui-input-inline">
                <select name="parkingNo" lay-filter="commname" id="commname">
                    <option value="">所属停车场</option>
                    {foreach $parkinglist as $parking}
                    <option value="{$parking.parkingNo}" {if isset($parkingNo)}{if $parkingNo == $parking.parkingNo} selected {/if}{/if}>{$parking.parkingName}</option>
                    {/foreach}
                </select>
            </div>


            <input type="text" name="plateNumber"  placeholder="车牌号码" autocomplete="off" class="layui-input" value="{if isset($plateNumber)}{$plateNumber}{/if}">
            <input type="text" name="pklot"  placeholder="车位号" autocomplete="off" class="layui-input" value="{if isset($pklot)}{$pklot}{/if}">
            <input type="text" name="empName"  placeholder="姓名" autocomplete="off" class="layui-input" value="{if isset($empName)}{$empName}{/if}">
            <input type="text" name="empMoblie"  placeholder="手机号" autocomplete="off" class="layui-input" value="{if isset($empMoblie)}{$empMoblie}{/if}">

            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
    </div>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加车位组','{:url(\'add\')}',500,560)"><i class="layui-icon"></i>添加车位组</button>

        <span class="x-right" style="line-height:40px">共有数据：{$number} 条</span>
    </xblock>
    <table class="layui-table" id="table">
        <thead  style="text-align:center;">
        <tr>

            <th style="text-align: center; font-size: 16px;">停车场</th>
            <th style="text-align: center; font-size: 16px;">车牌</th>
            <th style="text-align: center; font-size: 16px;">车位号</th>
            <th style="text-align: center; font-size: 16px;">业主姓名</th>
            <th style="text-align: center; font-size: 16px;">业主电话</th>
            <th style="text-align: center; font-size: 16px;">房屋号</th>
            <th style="text-align: center; font-size: 16px;">操作</th>
        </tr>
        </thead>
        <tbody style="text-align:center;">
        {foreach $list as $lis}
        <tr>

            <td style="text-align: center;">{$lis.parkingNo}</td>

            <td style="text-align: center;">{$lis.plateNumber}</td>
            <td style="text-align: center;">{$lis.pklot}</td>
            <td style="text-align: center;">{$lis.empName}</td>
            <td style="text-align: center;">{$lis.empMoblie}</td>
            <td style="text-align: center;max-width: 200px">{$lis.familyAddress}</td>
            <td class="td-manage" style="text-align: center;">
                <a title="删除" onclick="del('{$lis.id}','{$lis.id}')" href="javascript:;" id="{$lis.id}">
                    <i class="layui-icon">&#xe640;</i>
                </a>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    <div class="page">
        <div>
            {$datalist->render()|raw}
        </div>
    </div>

</div>
<script>
    //删除
    function del(id, doc){
        if(confirm('确定要删除吗?'))
        {
            var url = "{:url('del')}?id=" + id
            // console.log(url)
            $('#' + doc).attr('href', url)
        }
        return false;
    }
    //删除
    function del2(id){
        if(confirm('确定要删除吗?')){
            var url = '{:url("del")}'
            $.post(url, {id: id}, function(r){
                if (r.code==0) {
                    alert(r.imsg)
                    location.reload()
                }else{
                    alert(r.msg)
                    location.reload()
                }
            })
        }

    }
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });
    function payurl(id){
        layer.open({
            type: 1,
            skin: 'x-right', //样式类名
            closeBtn: 0, //不显示关闭按钮
            anim: 2,
            shadeClose: true, //开启遮罩关闭
            area: ['80%', '300px'],
            content:
                '<div style="padding: 20px 100px; font-size:18px">'+

                '缴费：https://www.aliwgzf.com/index/h5pay/gatepay?gateid='+ id + '<br><br>'+

                '</div>'
        });
    }

</script>


</body>

</html>